import fetch from 'common/src/utils/fetch'

let api = {
    // 查询列表
    getList(data) {
        return fetch({
            url: '/api/designservice/applicationStudent/list',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 查学生信息
    getStuInfo(data) {
        return fetch({
            url: '/api/designservice/common/studentInfo',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 保存课题
    save(data) {
        return fetch({
            url: '/api/designservice/applicationStudent/save',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 提交选题
    submit(data) {
        return fetch({
            url: '/api/designservice/applicationStudent/createFlow',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 编辑课题
    update(data) {
        return fetch({
            url: '/api/designservice/applicationStudent/edit',
            method: 'put',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 确认课题
    confirm(id) {
        return fetch({
            url: '/api/designservice/applicationStudent/choose?id=' + id,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            }
        })
    },
    // 查校内导师
    getInnerTutor(data) {
        return fetch({
            url: '/api/designservice/tutor/inner/getSelect',
            method: 'post',
            headers: { 'Content-Type': 'application/json' },
            data
        });
    },
    // 查课题来源
    getSource(data) {
        return fetch({
            url: '/api/designservice/settingSubjectSource/queryOptionsByYear',
            method: 'post',
            headers: { 'Content-Type': 'application/json' },
            data
        });
    },
    // 查课题性质
    getNature(data) {
        return fetch({
            url: '/api/designservice/settingSubjectProperties/queryOptionsByYear',
            method: 'post',
            headers: { 'Content-Type': 'application/json' },
            data
        });
    },
    // 查社会实践
    getPractice(data) {
        return fetch({
            url: '/api/designservice/settingSubjectSociaPractice/queryOptionsByYear',
            method: 'post',
            headers: { 'Content-Type': 'application/json' },
            data
        });
    },
    // 查学院
    getCollege() {
        let authId = localStorage.getItem('activeAuthId')
        return fetch({
            url: `/api/designservice/common/college?authId=${authId}`,
            method: 'get',
            headers: {
                'Content-Type': 'application/json'
            }
        })
    },
    // 根据年份和学院查专业
    getSubject(data) {
        return fetch({
            url: '/api/designservice/common/findSubject',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    },
    // 根据年级专业查方向
    getDirection(data) {
        return fetch({
            url: '/api/commonservice/directionMainten/findDirectionMaintenList',
            method: 'post',
            headers: {
                'Content-Type': 'application/json'
            },
            data
        })
    }
}

export default api
